#!/bin/bash
echo "=== 检测可用工具链 ==="

echo ""
echo "1. Visual Studio 工具链:"
if [ -f "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/Tools/VsDevCmd.bat" ]; then
    echo "   ✅ VS2022 Enterprise"
fi
if [ -f "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/VsDevCmd.bat" ]; then
    echo "   ✅ VS2022 Community" 
fi
if [ -f "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/Tools/VsDevCmd.bat" ]; then
    echo "   ✅ VS2017 Community"
fi

echo ""
echo "2. MinGW 工具链:"
if command -v gcc > /dev/null 2>&1; then
    echo "   ✅ GCC: $(gcc --version | head -1)"
else
    echo "   ❌ GCC 未找到"
fi

echo ""
echo "3. CMake:"
if command -v cmake > /dev/null 2>&1; then
    echo "   ✅ $(cmake --version | head -1)"
else
    echo "   ❌ CMake 未找到"
fi

echo ""
echo "4. Git:"
if command -v git > /dev/null 2>&1; then
    echo "   ✅ $(git --version)"
else
    echo "   ❌ Git 未找到"
fi

echo ""
echo "5. 数据库客户端:"
if command -v sqlite3 > /dev/null 2>&1; then
    echo "   ✅ SQLite3: $(sqlite3 --version)"
else
    echo "   ❌ SQLite3 未找到"
fi

if [ -f "C:/Program Files/PostgreSQL/13/bin/psql.exe" ]; then
    echo "   ✅ PostgreSQL 13"
fi

echo ""
echo "💡 推荐使用: VS2022 Enterprise (性能最佳)"
